


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
	</head>
	<body>

		<html:form styleId="macForm"
			action="listMac.do?method=getMacPartialList">
			<input type="hidden" id="totalPage" value="${totalPage}" />
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12"></img>
						系统管理 &gt; MAC地址管理
					</td>
				</tr>
			</table>


			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margb5">
				<tr>
					<td colspan="8" class="bgcolor2 padlr5">
						<table border="0" cellspacing="0" cellpadding="0" class="lan13b">
							<tr>
								<td width="25" align="center">
									<img src="<%=applicationPath%>/images/tianjia.gif"
										alt="<bean:message key='com.manager.common.mac.add'  bundle="macKey"/>"
										height="15" width="15" />
								</td>
								<td class="lieb-zi" width="40">
									<a href="#" onClick="addMac();"><bean:message
											key='com.manager.common.mac.add' bundle="macKey" /> </a>
								</td>
								<td width="25" align="center">
									<img src="<%=applicationPath%>/images/bianji.gif"
										alt="<bean:message key='com.manager.common.mac.modify'  bundle="macKey"/>"
										height="15" width="15" />
								</td>
								<td class="lieb-zi" width="40">
									<a href="#" onClick="modifyMac();"><bean:message
											key='com.manager.common.mac.modify' bundle="macKey" /> </a>
								</td>

								<td width="25" align="center">
									<img src="<%=applicationPath%>/images/shanchu.gif"
										alt="<bean:message key='com.manager.common.mac.del'  bundle="macKey"/>"
										height="15" width="15" />
								</td>
								<td class="lieb-zi" width="40">
									<a href="#" onClick="delMac();"><bean:message
											key='com.manager.common.mac.del' bundle="macKey" />
									</a>
								</td>


								<td width="25" align="center">
									<img src="<%=applicationPath%>/images/chakan.gif"
										alt="<bean:message key='com.manager.common.mac.view'  bundle="macKey"/>"
										height="15" width="15" />
								</td>
								<td width="40" class="lieb-zi">
									<a href="#" onClick="view();"><bean:message
											key='com.manager.common.mac.view' bundle="macKey" /> </a>
								</td>
								<td class="lieb-zi">
									&nbsp;
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>

						<fmt:bundle
							basename="com.application.mac.struts.ApplicationResources_mac">
							<display:table name="macList" class="simple" id="macTab"
								pagesize="15" partialList="true" style=" width:100%;"
								defaultorder="descending" size="resultSize"
								requestURI="listMac.do?method=getMacPartialList">
								<display:column title="选择" sortable="false"
									style=" width:5%; text-align:center;">
									<input type="checkbox" name="id" value="${macTab.id}" />
								</display:column> 
								<display:column property="mac"
									titleKey="com.application.mac.entity.mac.listpage.mac"
									sortable="false" style="width:15%; text-align:center;" />
								<display:column property="special"
									titleKey="com.application.mac.entity.mac.listpage.special"
									sortable="false" style="width:15%; text-align:center;" />
								<display:column property="createDate"
									titleKey="com.application.mac.entity.mac.listpage.createDate"
									sortable="false" style="width:15%; text-align:center;" />
							</display:table>
						</fmt:bundle>
					</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="listMac.do?method=getMacPartialList";
	document.forms[0].submit();
}

//新增
function addMac(){
    document.forms[0].action="toAddMac.do?method=toAddMac";
	document.forms[0].submit();
}

//修改
function modifyMac(){
    var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能编辑一条记录！");
		return;
	}else{
		document.forms[0].action="toUpdateMac.do?method=toUpdateMac";
	        document.forms[0].submit();
	}
	
}

//删除
function delMac()
{
	var ids = getSelectedIds('id');
	if( ids=="" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("是否要删除所选的信息？") )
	{
		document.forms[0].action="deleteMac.do?method=deleteMac&ids=" + ids;
		document.forms[0].submit();
	}
}
	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewMac.do?method=viewMac";
	    document.forms[0].submit();
	}
}


//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   
</script>
